{% extends "WileadUserManagerBundle::layout.html.twig" %}

{% block container -%}
<form method="get" action="">
    {{ form_rest(filter) }}
    <input class="btn btn-info" type="submit" name="submit-filter" value="搜索" />
    <a class="btn" href="{{ path('manager_albums') }}">清空条件</a>
</form>
<h1>图片管理</h1>

<div class="row">
    <div class="span12">
        <ul class="preview-list">
            {% for entity in entities %}
            <li>
                <a target="_blank" href="{{ entity.url }}"><img class="img-polaroid" src="{{ entity.url|apply_filter('thumbnail') }}" /></a>
                <div>
                    <strong>{{ entity.User.nickname }}</strong><br />
                        {{ entity.created.format('Y-m-d H:i:s') }}<br />
                    <a class="deleteLink" href="{{ path('manager_albums_delete', { 'id': entity.id }) }}">删除</a>
                </div>
            </li>
            {% endfor %}
        </ul>
    </div>
</div>

<div class="row">
    <div class="span12">
        <div class="navigation">
            {{ knp_pagination_render(entities) }}
        </div>
    </div>
</div>
{% endblock container -%}

{% block stylesheets %}
{{ parent() }}
<style>
    ul.preview-list {
        list-style: none;
        margin: 0;
        padding: 0;
    }

    ul.preview-list li {
        margin: 0;
        padding: 0;
        width: 195px;
        float: left;
        margin-bottom: 20px;
    }
</style>
{% endblock %}